package com.easy.frame.servers.sys.mapper.type;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.easy.frame.servers.sys.entity.SysEquipmentType;
import com.easy.frame.servers.sys.vo.SysEquipmentTypeVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 设备设施分类表 Mapper 接口
 * </p>
 *
 * @author tp
 * @since 2020-12-24
 */
public interface SysEquipmentTypeMapper extends BaseMapper<SysEquipmentType> {

    List<SysEquipmentType> getEquTypeTree(@Param("tenantId") Long tenantId, @Param("projId") int projId, @Param("enabled") int enabled);

    SysEquipmentTypeVO selectParentEquById(@Param("parentEquId") Integer parentEquId);

    Integer selectMaxSeq(@Param("tenantId") Long tenantId, @Param("projId") int projId, @Param("level") int level);

    SysEquipmentType checkEquCode(@Param("tenantId") Long tenantId, @Param("projId") int projId, @Param("code") String code);

    SysEquipmentType checkEquName(@Param("tenantId") Long tenantId, @Param("projId") int projId, @Param("name") String name);

    String selectMaxPath(@Param("tenantId") Long tenantId, @Param("projId") int projId, @Param("parentPath") String parentPath);

    int updateLeafNode(SysEquipmentType temp);

    int countById(@Param("id") Long id);

    int updateDelete(@Param("id") Long id);

    List<SysEquipmentType> selectEquipmentTypebyName(@Param("tenantId") Long tenantId, @Param("projectId") Long projectId, @Param("name") String name, @Param("parentPath") String parentPath);

    List<SysEquipmentType> selectEquipmentTypebyLevel(@Param("tenantId") Long tenantId, @Param("projectId") Long projectId, @Param("name") String name, @Param("level") Integer level);

    List<SysEquipmentType> selectEquipmentTypes(SysEquipmentType temp);

    SysEquipmentType selectHaveChild(Long tenantId, Long projectId, String path);

    SysEquipmentType selectEquipmentTypeNotEnable(Long tenantId, Long projectId, String path);

    SysEquipmentType selectEquipmentTypeByParentpath(Long tenantId, Long projectId, String parentPath);

    int selectByParentpath(Long tenantId, Long projectId, String parentPath);

    int updateByParentPath(SysEquipmentType sysEquipment);

}
